package com.firefly.netty;

import com.firefly.netty.demo.NettyServer;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class NettyApplication implements CommandLineRunner {
	public static void main(String[] args) {
		SpringApplication.run(NettyApplication.class, args);
	}

	@Override
	public void run(String ...args){
		// 开启netty服务
		new Thread(() -> {
			try {
				new NettyServer().run();
			}catch (Exception e){
				e.printStackTrace();
			}
		}).start();
	}
}